// 获取 OEM CDN 域名的辅助函数
const getOEMCdnDomain = () => {
  // @ts-ignore
  if (typeof window !== 'undefined' && window.OEM_CONFIG) {
    // @ts-ignore
    return window.OEM_CONFIG.cdnDomain;
  }
  return 'cdn.appthen.com'; // 默认值
};

export default {
  packages: [
    {
      package: 'iconfont-icons',
      urls: `https://${getOEMCdnDomain()}/editor/npm/t/font_2369445_ukrtsovd92r.js`,
    },
    {
      package: '@ant-design/icons',
      version: '4.7.0',
      urls: [
        `https://${getOEMCdnDomain()}/editor/npm/@ali/ant-design-icons-cdn/4.5.0/index.umd.min.js`,
      ],
      library: 'icons',
    },
    {
      package: 'antd',
      version: '4.23.0',
      urls: [`https://${getOEMCdnDomain()}/editor/npm/antd/4.23.0/antd.min.js`],
      library: 'antd',
    },
    {
      package: '@alilc/antd-lowcode-materials',
      version: '1.1.1',
      library: 'AntdLowcode',
      urls: [
        `https://${getOEMCdnDomain()}/editor/npm/@alilc/antd-lowcode-materials@1.1.1/build/lowcode/view.js`,
        `https://${getOEMCdnDomain()}/editor/npm/@alilc/antd-lowcode-materials@1.1.1/build/lowcode/view.css`,
      ],
      editUrls: [
        `https://${getOEMCdnDomain()}/editor/npm/@alilc/antd-lowcode-materials@1.1.1/build/lowcode/view.js`,
        `https://${getOEMCdnDomain()}/editor/npm/@alilc/antd-lowcode-materials@1.1.1/build/lowcode/view.css`,
      ],
    },
    {
      package: '@alifd/layout',
      version: '2.0.12',
      library: 'AlifdLayout',
      urls: [
        `https://${getOEMCdnDomain()}/editor/npm/@alifd/layout@2.0.12/dist/AlifdLayout.js`,
        `https://${getOEMCdnDomain()}/editor/npm/@alifd/layout@2.0.12/dist/AlifdLayout.css`,
      ],
      editUrls: [
        `https://${getOEMCdnDomain()}/editor/npm/@alifd/layout@2.0.12/build/lowcode/view.js`,
        `https://${getOEMCdnDomain()}/editor/npm/@alifd/layout@2.0.12/build/lowcode/view.css`,
      ],
    },
    {
      package: '@seada/antd-materials',
      version: '1.0.0-rc.27',
      library: 'SeadaAntdMaterials',
      urls: [
        `https://${getOEMCdnDomain()}/editor/npm/@seada/antd-materials@1.0.0-rc.27/build/lowcode/view.js`,
        `https://${getOEMCdnDomain()}/editor/npm/@seada/antd-materials@1.0.0-rc.27/build/lowcode/view.css`,
        `https://${getOEMCdnDomain()}/editor/npm/antd/4.23.0/antd.min.css`,
      ],
      editUrls: [
        `https://${getOEMCdnDomain()}/editor/npm/@seada/antd-materials@1.0.0-rc.27/build/lowcode/view.js`,
        `https://${getOEMCdnDomain()}/editor/npm/@seada/antd-materials@1.0.0-rc.27/build/lowcode/view.css`,
        `https://${getOEMCdnDomain()}/editor/npm/antd/4.23.0/antd.min.css`,
      ],
    },
  ],
  components: [
    {
      exportName: 'AlilcAntdLowcodeMaterialsMeta',
      npm: {
        package: '@alilc/antd-lowcode-materials',
        version: '1.1.1',
      },
      url: `https://${getOEMCdnDomain()}/editor/npm/@alilc/antd-lowcode-materials@1.1.1/build/lowcode/meta.js`,
      urls: {
        default: `https://${getOEMCdnDomain()}/editor/npm/@alilc/antd-lowcode-materials@1.1.1/build/lowcode/meta.js`,
      },
    },
    {
      exportName: 'SeadaAntdMaterialsMeta',
      npm: {
        package: '@seada/antd-materials',
        version: '1.0.0-rc.27',
      },
      url: `https://${getOEMCdnDomain()}/editor/npm/@seada/antd-materials@1.0.0-rc.27/build/lowcode/meta.js`,
      urls: {
        default: `https://${getOEMCdnDomain()}/editor/npm/@seada/antd-materials@1.0.0-rc.27/build/lowcode/meta.js`,
      },
    },
  ],
  sort: {
    groupList: ['精选组件', '原子组件'],
    categoryList: [
      '基础元素',
      '布局容器类',
      '表格类',
      '表单详情类',
      '帮助类',
      '对话框类',
      '业务类',
      '通用',
      '引导',
      '信息输入',
      '信息展示',
      '信息反馈',
    ],
  },
  groupList: ['精选组件', '原子组件'],
  ignoreComponents: {},
};
